package com.zzyl.mapper;

import com.zzyl.entity.Bed;
import com.zzyl.vo.BedVo;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface BedMapper {

    List<BedVo> getBedsByRoomId(Long roomId);
@Insert("Insert Into zzyl.bed(bed_number, bed_status, sort, room_id, create_time, update_time, create_by, update_by, remark) VALUES " +
        "(#{bedNumber},#{bedStatus},#{sort},#{roomId},#{createTime},#{updateTime},#{createBy},#{updateBy},#{remark})")
    void addBed(Bed bed);

    void updateBed(Bed bed);
@Select("select * from zzyl.bed where id=#{id}")
    BedVo selectById(Long id) ;
@Delete("delete from  zzyl.bed where id=#{id}")
    void deleteById(Long id);

    Long repeatBedNumber(String bedNumber);

    Long countDiffBedNumber(@Param("bedNumber") String bedNumber, @Param("id") Long id);

    Long getStatusByBed(Long id);
}

